
<div class="row" >
  <div class="col-md-6 col-sm-8 col-sm-push-2">
    <form class="form form-horizontal" [formGroup]="resourcesForm" >
      <div class="one-form-header"></div>
      <div class="one-form-body">
        <div class="form-group">
          <label for="resource_add_resourceName" class="col-sm-4 control-label">资源名称:</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" placeholder="资源名称" id="resource_add_resourceName" name="name" required formControlName="name">
            <div *ngIf="formErrors.name" class="has-error">
              <label class="control-label"><i class="fa fa-times-circle-o"></i>{{formErrors.name}} </label>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label for="resource_add_URI" class="col-sm-4 control-label">资源URL:</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" placeholder="资源URL" id="resource_add_URI" name="url" required formControlName="url">
            <div *ngIf="formErrors.url" class="has-error">
              <label class="control-label"><i class="fa fa-times-circle-o"></i>{{formErrors.url}} </label>
            </div>
          </div>
        </div>
        <div class="row">
          <label class="col-sm-4 control-label">是否显示:</label>
          <div class="col-sm-8">
            <div class="row">
              <div class="col-xs-4">
                <input type="radio" name="isShow" id="resource_add_show" value="1" formControlName="isShow">
                <label for="resource_add_show">
                  显示
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" name="isShow" id="resource_add_hide" value="0" checked formControlName="isShow">
                <label for="resource_add_hide">
                  隐藏
                </label>
              </div>
            </div>
          </div>
        </div>
        <div class="row">
          <label class="col-sm-4 control-label">是否有效:</label>
          <div class="col-sm-8">
            <div class="row">
              <div class="col-xs-4">
                <input type="radio" name="isValid" id="resource_add_valid" value="1" formControlName="isValid">
                <label for="resource_add_valid">
                  有效
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" name="isValid" id="resource_add_invalid" value="0" checked formControlName="isValid">
                <label for="resource_add_invalid">
                  无效
                </label>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="one-form-footer">
        <div class="pull-right">
          <button class="btn btn-default" type="reset" (click)="cancelResourceAdd()">取消</button>
          <button class="btn btn-success" type="button" [disabled]="resourcesForm.invalid" (click)="onSubmit()">提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
